/*
 * @Author: zhang gen yuan
 * @Date: 2021-05-12 16:58:15
 * @Descripttion: 
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes';
import store from '@store/index'
Vue.use(VueRouter)
const router = new VueRouter({
  routes:routes,
  mode:"history"
})
// router.beforeEach((to, from, next) => {
//   if (to.meta.requireAuth) {
//     if(store.state.user.info && store.state.user.info.access_token){
//       next();
//     }else {
//      if(to.path === '/login'){
//         next();
//       }else {
//         next({
//           path:'/login'
//         })
//       }
//     }
//   }
//   else {
//     next();
//   }
//   if(to.fullPath == "/login"){
//     if(store.state.user.info && store.state.user.info.access_token){
//       next({
//         path:from.fullPath
//       });
//     }else {
//       next();
//     }
//   }
// });
export default router






